#!/usr/bin/env python
"""This program runs the various network training based on the selected features. The approach
is a leave one out in obtaining features and training the neural networks. The naming convention 
uss the numeric label of the case that was *left out* in the training process. Thus the
file features_001.data contains the features computed using all the cases *except* 1.jpg (1.data)
"""
import subprocess
import os
import glob

files = glob.glob(os.path.join("data","features_*.data"))

for f in files:
    print f
    print "training neural networks withe prior feature reduction"
    subprocess.call("""python GaborMatchingXV.py -nn %s"""%f,shell=True)
    print "computing principle eigenvectors"
    subprocess.call("""python GaborMatchingXV.py -pca %s"""%f,shell=True)
    print "training neural networks using principle eigenvectors"
    subprocess.call("""python GaborMatchingXV.py -nnpca %s"""%f,shell=True)


